<!-- TEMPLATE ANIMAL AFFICHER -->

<section id="content">
    
    <!-- Tableau obligatoire ! Structure du calendrier ! -->
    <table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;">
        <tr>
            <td id="ds_calclass"></td>
        </tr>
    </table>

    <!-- -->
    
    <h1 class="article">{#ANIMAL#}</h1>

    <div class="liste_deroulante article">
        <p class="entete_liste">{#INFORMATIONS_GENERAL#}</p>
        <table class="contenu_liste">
            <tr>
                <td class="description">{#ID#}</td>
                <td class="valeurAnimal">{$animal->getId()}</td>
                {if $animal->getPhotoProfil()}
                <td class="photo" rowspan="8"><img src="uploads/{$animal->getPhotoProfil()}" alt="Photo de l'animal" /></td>
                {/if}
            </tr>
            <tr>
                <td>{#NOM_SPA#}</td>
                <td>{$animal->getNom()}</td>
            </tr>
            <tr>
                <td>{#TYPE_ANIMAL#}</td>
                <td>{$animal->getTypeDeRace_nom()}</td>
            </tr>
            <tr>
                <td>{#RACE#}</td>
                <td>
                    {section name="uneRaceToAnimal" loop=$listeRacesToAnimal}
                        {$listeRacesToAnimal[uneRaceToAnimal]->getRace_nom()}
                    {/section}
                </td>
            </tr>
            <tr>
                <td>{#SEXE#}</td>
                <td>{$animal->getSexe()}</td>
            </tr>
            <tr>
                <td>{#COULEUR#}</td>
                <td>{$animal->getCouleur()}</td>
            </tr>
            <tr>
                <td>{#DATE_NAISSANCE#}</td>
                <td>{$animal->getDateNaissance()|date_format:'%d/%m/%Y'}</td>
            </tr>
            <tr>
                <td>{#DATE_DECES#}</td>
                <td>{$animal->getDateDeces()|date_format:'%d/%m/%Y'}</td>
            </tr>
        </table>
        <p class="entete_liste">{#INFORMATIONS_SUPPL#}</p>
        <table class="contenu_liste">
            <tr>
                <td class="description">{#DEUXIEME_NOM#}</td>
                <td class="valeur">{$animal->getSecondNom()}</td>
            </tr>
            <tr>
                <td>{#LONGUEUR_POIL#}</td>
                <td>{$animal->getLongueurPoil()}</td>
            </tr>
            <tr>
                <td>{#NO_PUCE#}</td>
                <td>{$animal->getPuceNo()}</td>
            </tr>
            <tr>
                <td>{#IMPLANTATION#}</td>
                <td>{$animal->getImplantation()}</td>
            </tr>
            <tr>
                <td>{#TATOUAGE#}</td>
                <td>{$animal->getTatouage()}</td>
            </tr>
            <tr>
                <td>{#MEDAILLE#}</td>
                <td>{$animal->getMedaille()}</td>
            </tr>
            <tr>
                <td>{#PARTICULARITES#}</td>
                <td>{$animal->getRemarque()}</td>
            </tr>
        </table>
        <p class="entete_liste">{#HISTORIQUE#}</p>
        <div class="contenu_liste">
            <form id="formHistorique" name="formulaire" action="?action=ajouterHistorique" method="post" >
                <table>
                    <tr>
                        <th class="anHistDate">{#DATE#}</th>
                        <th class="anHistCause">{#CAUSE#}</th>
                        <th class="anHistPers">{#PERS#}</th>
                        <th class="anHistNPA">{#NPA#}</th>
                        <th class="anHistCom">{#COMMENTAIRE#}</th>
                    </tr>
                    {section name="unHistorique" loop=$historique}
                    <tr>
                        <td>{$historique[unHistorique]->getDateHeure()|date_format:'%d/%m/%Y<br />%H:%M'}</td>
                        <td>{$historique[unHistorique]->getCause_nom()}</td>
                        <td>{$historique[unHistorique]->getPersonne_id()}</td>
                        <td>{$historique[unHistorique]->getLocalite_npa()}</td>
                        <td>{$historique[unHistorique]->getCommentaire()}</td>
                        <td><a class="anHistSupprimer" href="?action=supprimerHistorique&dateHistorique={$historique[unHistorique]->getDateHeure()}&idAnimal={$historique[unHistorique]->getAnimal_id()}">{#SUPPRIMER#}</a></td>
                    </tr>
                    {/section}
                    <tr>
                        <td class="anHistDate">
                            <input type="hidden" name="animalId" value="{$animal->getId()}" />
                            <input type="text" name="dateHistorique" onClick="ds_sh(this);" class="validate[optional,custom[date]] text-input"/>
                        </td>
                        <td>
                            <select name="typeHistorique" onchange="{literal}showCausesHistorique(this.value){/literal}" >
                            {section name="unTypeCauseHistorique" loop=$typeCauseHistorique}
                                <option value="{$typeCauseHistorique[unTypeCauseHistorique]->getNom()}">{$typeCauseHistorique[unTypeCauseHistorique]->getNom()}</option>
                            {/section}
                            </select>
                            <br />
                            <select name="causeHistorique" id="causesHint">
                                <option value="">---</option>
                            </select>
                        </td>
                        <td class="anHistPers"><input type="text" name="personneHistorique" /></td>
                        <td class="anHistNPA"><input type="text" name="npaHistorique" /></td>
                        <td class="anHistCom"><input type="text" name="commentaireHistorique" /></td>
                        <td class="anHistAjouter"><input type="submit" class="submit" name="ajouterhistorique" value="{#AJOUTER#}" /></td>
                    </tr>
                </table>
            </form>
        </div>
        <p class="entete_liste">{#DEPLACEMENT#}</p>
        <div class="contenu_liste">
            <form id="formDeplacement" name="formulaire" action="?action=ajouterDeplacement" method="post" >
                <table>
                    <tr>
                        <th class="anDeplID">{#ID#}</th>
                        <th class="anDeplDate">{#DATE#}</th>
                        <th class="anDeplBat">{#BATIMENT_NOM#}</th>
                        <th class="anDeplLoge">{#LOGE_NOM#}</th>
                        <th class="anDeplSupprimer"></th>
                    </tr>
                    {if $deplacements|@count gt 0}
                    {section name="unDeplacement" loop=$deplacements}
                    <tr>
                        <td>{$deplacements[unDeplacement]->getId()}</td>
                        <td>{$deplacements[unDeplacement]->getDateHeure()|date_format:'%d/%m/%Y %H:%M'}</td>
                        <td>{$deplacements[unDeplacement]->getBatiment_nom()}</td>
                        <td>{$deplacements[unDeplacement]->getLoge_nom()}</td>
                        <td><a class="anHistSupprimer" href="?action=supprimerDeplacement&idDeplacement={$deplacements[unDeplacement]->getId()}&idAnimal={$deplacements[unDeplacement]->getAnimal_id()}">{#SUPPRIMER#}</a></td>
                    </tr>
                    {/section}
                    {/if}
                    <tr>
                        <td><input type="hidden" name="animalId" value="{$animal->getId()}" /></td>
                        <td class="anHistDate">
                            <input type="text" name="dateDeplacement" onClick="ds_sh(this);" class="validate[optional,custom[date]] text-input"/>
                        </td>
                        <td>
                            <select name="batimentDeplacement" onchange="{literal}showLoges(this.value){/literal}" >
                            {section name="unBatiment" loop=$batiments}
                                <option value="{$batiments[unBatiment]->getNom()}">{$batiments[unBatiment]->getNom()}</option>
                            {/section}
                            </select>
                        </td>
                        <td>
                            <select name="logeDeplacement" id="logesHint" >
                                <option value="">---</option>
                            </select>
                        </td>
                        <td class="anHistAjouter"><input type="submit" class="submit" name="ajouterDeplacement" value="{#AJOUTER#}" /></td>
                    </tr>
                </table>
            </form>
        </div>
        <p class="entete_liste">{#REMARQUE#}</p>
        <div class="contenu_liste">
            <form id="formRemarque" name="formulaire" action="?action=ajouterRemarque" method="post" >
                <table>
                    <tr>
                        <th class="anRemID">{#ID#}</th>
                        <th class="anRemDate">{#DATE#}</th>
                        <th class="anRemType">{#TYPE#}</th>
                        <th class="anRemPers">{#PERS#}</th>
                        <th class="anRemarque">{#REMARQUE#}</th>
                        <th class="anRemAction"></th>
                    </tr>
                    {if $remarques|@count gt 0}
                    {section name="uneRemarque" loop=$remarques}
                    <tr>
                        <td>{$remarques[uneRemarque]->getId()}</td>
                        <td>{$remarques[uneRemarque]->getDateHeure()|date_format:'%d/%m/%Y %H:%M'}</td>
                        <td>{$remarques[uneRemarque]->getType()}</td>
                        <td>{$remarques[uneRemarque]->getPersonne_id()}</td>
                        <td class="anRemarque">{$remarques[uneRemarque]->getRemarque()}</td>
                        <td><a class="anHistSupprimer" href="?action=supprimerRemarque&idRemarque={$remarques[uneRemarque]->getId()}&idAnimal={$remarques[uneRemarque]->getAnimal_id()}">{#SUPPRIMER#}</a></td>
                    </tr>
                    {/section}
                    {/if}
                    <tr>
                        <td><input type="hidden" name="animalId" value="{$animal->getId()}" /></td>
                        <td class="anHistDate"><input type="text" name="dateRemarque" onClick="ds_sh(this);" class="validate[optional,custom[date]] text-input"/></td>
                        <td class="anRemType"><input type="text" name="typeRemarque" /></td>
                        <td class="anHistPers"><input type="text" name="personneRemarque" /></td>
                        <td class="anRemarque"><input type="text" name="remarqueRemarque" /></td>
                        <td class="anHistAjouter"><input type="submit" class="submit" name="ajouterRemarque" value="{#AJOUTER#}" /></td>
                    </tr>
                </table>
                
            </form>
        </div>
        <p class="entete_liste">{#MEDIA#}</p>
        <div class="contenu_liste">
            <form id="formID" name="formulaire" action="?action=ajouterMedia" method="post" enctype="multipart/form-data" >
                <table>
                    <tr>
                        <th>{#DATE#}</th>
                        <th>{#FICHIER#}</th>
                    </tr>
                    {if $medias|@count gt 0}
                    {section name="unMedia" loop=$medias}
                    <tr>
                        <td>{$medias[unMedia]->getDate()|date_format:'%d/%m/%Y'}</td>
                        <td><a href="uploads/{$medias[unMedia]->getUrl()}">{$medias[unMedia]->getUrl()}</a></td>
                        <td><a href="?action=supprimerMedia&url={$medias[unMedia]->getUrl()}&idAnimal={$medias[unMedia]->getAnimal_id()}">x</a></td>
                    </tr>
                    {/section}
                    {/if}
                    <tr>
                        <td><input type="hidden" name="animalId" value="{$animal->getId()}" /></td>
                        <td><input type="file" name="photoProfil" accept="image/*;capture=camera" /></td>
                        <td><input type="submit" class="submit" name="ajouterMedia" value="{#AJOUTER#}" /></td>
                    </tr>
                </table>
                
            </form>
        </div>
        <p class="entete_liste">{#CONTRATS#}</p>
        <div class="contenu_liste">
                Infos
        </div>
        <p class="entete_liste">{#PLAINTES_ET_RAPPORTS#}</p>
        <div class="contenu_liste">
                Infos
        </div>
        
    </div>
    
        
    <p class="actions">   
        <a class="actions" href="?action=afficherModifierAnimal&id={$animal->getId()}">{#MODIFIER#}</a>
        <a class="actions" href="?action=afficherRechercherAnimal">{#RETOUR#}</a>
    </p>    
    
 

</section>
    
